﻿<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/html">

<head>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>新增反馈</title>
    {include file='common/header'}
    <link href="/static/home/mobile/css/reset_5.css" rel="stylesheet" type="text/css"/>
    <link href="/static/home/mobile/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="/static/home/mobile/css/new_style.css" rel="stylesheet" type="text/css"/>
  <style type="text/css">
        /** -- 文件上传样式 --**/
 .file-up {
    position: relative;
    display: inline-block;
    background:#f96a22;
    border: 1px solid #f96a22;
    border-radius: 4px;
    padding: 4px 12px;
    overflow: hidden;
    color:#FFFFFF;
    text-decoration: none;
    text-indent: 0;
    line-height: 20px;
   /*	height: 30px;*/
	min-width: 60px;
    font-size:12px;
   text-align: center;
}
.file-up input {
    position: absolute;
    font-size: 100px;
    right: 0;
    top: 0;
    opacity: 0;
}
.file-up:hover {
    background: #AADFFD;
    border-color: #78C3F3;
    color: #004974;
    text-decoration: none;
}
     .file-up:link ,.file-up:visited{
        color:#FFFFFF;
      } 
  
  </style>
</head>
<body>
    <div class="site-header header-fixed">
        <a onclick="history.back()" class="back"></a>
        <div class="tit-name">新增反馈</div>
         <span class="dowm-btn publish-task-btn" style="width: 120px;height: auto;top: -10px;font-size: 14px">
        <a href="/home/feedback.html" class="sc" style="color: #5f4242;">反馈记录</a>
    </div>
    <div class="main bindMail">
        <div class="member-form">
            <div class="item-box" style="height: auto;">
                <textarea id="content" name="content" placeholder="请输入您需要反馈的内容" style="width: 100%;height: 200px;"></textarea>
            </div>
        </div>
      
      <form id="form1">
        <div>
          <b style="font-size: 30px">图片：</b><a href="javascript:;" class="file-up">上传图片<input type="file" id="upimg1" style="width: 300px;height: 40px;border-radius:9px;" class="file_up"></a>
        </div>
        </form>
        <input type="hidden" id="img1">
      <img src="" style="width: 200px;height: 180px; display: none" id="xianshi1">
      <form id="for2m">
        <div>
          <b style="font-size: 30px">图片：</b><a href="javascript:;" class="file-up">上传图片<input type="file" id="upimg2" style="width: 300px;height: 40px;border-radius:9px;" class="file_up"></a>
        </div>
        </form>
        <input type="hidden" id="img2" >
      <img src="" style="width: 200px;height: 180px; display: none" id="xianshi2">
      <form id="for3">
        <div>
          <b style="font-size: 30px">图片：</b><a href="javascript:;" class="file-up">上传图片<input type="file" id="upimg3" style="width: 300px;height: 40px;border-radius:9px;" class="file_up"></a>
        </div>
        </form>
        <input type="hidden" id="img3">
      <img src="" style="width: 200px;height: 180px; display: none" id="xianshi3">
      
      
      
      
        <div class="member-btn">
            <button type="button" class="button1 js-bind"  {$member['is_bind_email']?'disabled':''}>确认</button>
        </div>
       <!--  <div class="member-ts">
            <label>温馨提示</label>
            <p></p>
        </div> -->
    </div>
    <script type="text/javascript">
      $('#upimg1').change(function(){
        var form = new FormData(document.getElementById("form1"));
        form.append('upimg',$('#upimg1')[0].files[0]);
        $.ajax({
          url: '/home/feedback/upimg',
          type: 'post',
          data:form,
          dataType: 'json',
          processData:false,
          contentType: false,
          success: function(res) {
              $('#img1').val(res.img);
              $('#xianshi1').attr('src',res.img);
              $('#xianshi1').css('display','block');
          }
        })
      })
       $('#upimg2').change(function(){
        var form = new FormData(document.getElementById("form2"));
        form.append('upimg',$('#upimg2')[0].files[0]);
        $.ajax({
          url: '/home/feedback/upimg',
          type: 'post',
          data:form,
          dataType: 'json',
          processData:false,
          contentType: false,
          success: function(res) {
              $('#img2').val(res.img);
              $('#xianshi2').attr('src',res.img);
              $('#xianshi2').css('display','block');
          }
        })
      })
       $('#upimg3').change(function(){
        var form = new FormData(document.getElementById("form3"));
        form.append('upimg',$('#upimg3')[0].files[0]);
        $.ajax({
          url: '/home/feedback/upimg',
          type: 'post',
          data:form,
          dataType: 'json',
          processData:false,
          contentType: false,
          success: function(res) {
              $('#img3').val(res.img);
              $('#xianshi3').attr('src',res.img);
              $('#xianshi3').css('display','block');
          }
        })
      })
        $(function () {
            //设置邮箱
            $('.js-bind').click(function () {
                var content = $('#content').val();
                if ($.trim(content) == "") {
                    message("请输入您需要反馈的内容","","error");
                    return;
                }
                $.post(
                    '/home/feedback/save',
                    {
                      content: content,
                      img1:$('#img1').val(),
                      img2:$('#img2').val(),
                      img3:$('#img3').val()
                    },
                    function (ret) {
                        message(ret.message,ret.redirect,ret.type);
                    },'json'
                );
            });
        });
    </script>
</body>
</html>